home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Gamer (Italian) 30
/
PC Gamer IT CD 30 1-2.iso
/
MOTS
/
GAMEDATA
/
RESOURCE
/
JKMRES.GOO
/
cog_actor_s3.cog
< prev
next >
Wrap
Text File
|
1998-02-25
|
3KB
|
122 lines
# Jedi Knight Cog Script
#
# ACTOR_S3.COG
#
# ACTOR Script - Stormtrooper with Rail Detonator
#
# 7/28/97 [CR] Doubled saber damage for single player gameplay reasons
#
# [CYW, YB & CR]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
symbols
message killed
message damaged
message skill
template powerup=+DRailGun local
template limb=+stormlimb local
thing newThing local
int victim local
int bin local
int senderref=-1 local
ai flee_ai=noweapon.ai local
int damage local
vector currentpos local
end
# ========================================================================================
code
damaged:
damage = GetParam(0);
if(GetParam(1) == 16) // saber damage might cause dismemberment
{
damage = (damage * 2.0);
victim = GetSenderRef();
if(GetThingHealth(victim) <= damage) // but only if damage is sufficient to kill
{
if(rand() < 0.05) // random chance
{
AmputateJoint(victim, 5);
newThing = CreateThingAtPos(limb, GetThingSector(victim), GetThingPos(victim), '0 0 0');
SetThingVel(newThing, '0.0 0.7 1.4');
}
}
}
ReturnEx(damage);
return;
# ........................................................................................
killed:
victim = GetSenderRef();
if (GetActorWeapon( victim, 1 ) != -1)
{
AmputateJoint( victim, 3 );
newThing = CreateThing(powerup, GetSenderRef());
SetLifeleft(newThing, 200.0);
}
return;
# ........................................................................................
skill:
bin = GetParam(0);
if (bin == 24) // Force Pull
{
// he's a fighter, not a fleer... -srs
senderref = GetSenderRef();
// If he hasn't been pulled yet...
if (GetActorWeapon (senderref, 1) != -1)
{
SetActorWeapon(senderref, 1, -1);
newThing = CreateThing(powerup, GetSenderRef());
SetLifeleft(newThing, 30.0);
AISetClass (senderref, flee_ai);
AISetMode(senderref, 0x4);
ReturnEx(newThing);
}
else
{
// Give the actor a shove towards the player.
currentpos = VectorSub(GetThingPos(GetLocalPlayerThing(), senderref));
currentpos = VectorScale(VectorNorm(currentPos), 250);
ApplyForce(senderref, currentpos);
ReturnEx(-1);
}
//AIFlee(senderref, GetLocalPlayerThing());
Return;
}
else
if (bin == 31) // Force Grip
{
ReturnEx(10); // return base damage that is taken by this actor.
Return;
}
else
if (bin == 34) // Deadly Sight
{
ReturnEx(5); // return base damage that is taken by this actor.
Return;
}
ReturnEx(-1);
return;
end